<?php
// -----------------------------------------------------------------------------

include "config/config.php";
include "DBManager.php";

// -----------------------------------------------------------------------------

$path = explode("/", $dbPath);
if (!is_dir($path[0])) {
    mkdir($path[0]);
}

// -----------------------------------------------------------------------------

if (is_file($dbPath)) {

    $db = new DBManager($dbPath);
    $db->recreateTables();
    echo "数据库重建成功！";

} else {

    $db = new DBManager($dbPath);
    $db->createTables();
    echo "数据库创建成功！";

}
